package reservations

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ReservationRouter struct{}

// InitReservationRouter 初始化 reservation表 路由信息
func (s *ReservationRouter) InitReservationRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	reservationRouter := Router.Group("reservation").Use(middleware.OperationRecord())
	reservationRouterWithoutRecord := Router.Group("reservation")
	reservationRouterWithoutAuth := PublicRouter.Group("reservation")
	{
		reservationRouter.POST("createReservation", reservationApi.CreateReservation)             // 新建reservation表
		reservationRouter.DELETE("deleteReservation", reservationApi.DeleteReservation)           // 删除reservation表
		reservationRouter.DELETE("deleteReservationByIds", reservationApi.DeleteReservationByIds) // 批量删除reservation表
		reservationRouter.PUT("updateReservation", reservationApi.UpdateReservation)              // 更新reservation表
	}
	{
		reservationRouterWithoutRecord.GET("findReservation", reservationApi.FindReservation)       // 根据ID获取reservation表
		reservationRouterWithoutRecord.GET("getReservationList", reservationApi.GetReservationList) // 获取reservation表列表
	}
	{
		reservationRouterWithoutAuth.GET("getReservationPublic", reservationApi.GetReservationPublic) // reservation表开放接口
	}
}
